<body>
<div id="content">
<p id="description"></p>
Manual Steps:
<ol>
<li>Click "click me" in blue box below.</li>
<li>See caret in blue box.
</ol>
<div id="sample" contenteditable="true" style="border: solid 1px blue">click me</div>
</div>
<script src="../../resources/js-test.js"></script>
<script>
description("Caret position after removing node");

function $(id) { return document.getElementById(id); }

var sample = $('sample');

sample.addEventListener('focus', function() {
  this.innerHTML = '';
});

if (window.eventSender) {
    eventSender.mouseMoveTo(sample.offsetLeft + 5, sample.offsetTop + 5);
    eventSender.mouseDown(0);
    shouldBeEqualToString('getSelection().type', 'Caret');
    shouldBe('getSelection().focusNode', 'sample');
    shouldBe('getSelection().focusOffset', '0');
    $('content').outerHTML = '';
}
</script>
</body>
